<template>
        
  <div >
    <!-- <h1>列表</h1> -->
    <div v-if="list.length > 0">
      <goods-list :arr="list"></goods-list>
    </div>
    <van-empty v-else description="暂无数据" />
  </div>
</template>

<script>
import axios from "axios";
import goodsList from "../../components/goodslist.vue"
export default {
  components:{
    goodsList
  },
  data() {
    return {
      list: [],
    };
  },
  activated() {
    axios({
      url: "/api/getgoodlist",
      method: "get",
      params: {
        cateid: this.$route.query.id,
        type: this.$route.query.type,
      },
    }).then((res) => {
      console.log(res);
      this.list = res.data.list.goodData ? res.data.list.goodData : [];
    });
  },
};
</script>

<style scoped>
.list {
  background-color: crimson;
  margin: 0.2rem 0;
}
.list img {
  width: 3rem;
  height: 3rem;
}
</style>